package cn.edu.zafu.bigdata.YinMingyan.chapter06;

public class TestDivide {
    public static void main(String[] args) {
        try {
            //输出正常结果
            int result = Divide.divide(5, 5);
            System.out.println("The result is: " + result);
            // 调用divide方法并捕获异常
            int result2 = Divide.divide(5, 0);
            System.out.println("The result is: " + result2);

        } catch (ArithmeticException e) {
            // 输出错误信息
            System.out.println(e.getMessage());
        }
    }
}
